package tech.aistar.clothesspringboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import tech.aistar.clothesspringboot.pojo.Clothes;
import tech.aistar.clothesspringboot.pojo.ClothesStock;


@Mapper
public interface ClothesMapper {
    //查询所有的服装信息
     @Select("select * from clothes")
     List<Clothes> getClothesList();

     //根据名字查询衣服信息
     @Select("select * from clothes where clothes_name like concat('%',#{name},'%')")
     List<Clothes> getClothesByName(String name);

     //根据id查询衣服信息
     @Select("select * from clothes where clothes_id = #{id}")
     Clothes getClothesById(Integer id);

     //根据id查询库存
     @Select("select * from clothes_stock where clothes_id = #{id}")
     List<ClothesStock> getStockById(Integer id);
}
